package com.qfedu.service.impl;

import com.github.pagehelper.PageHelper;
import com.qfedu.dao.NoticeDao;
import com.qfedu.pojo.Notice;
import com.qfedu.service.NoticeService;
import com.qfedu.vo.VONotice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {
    @Autowired
    private NoticeDao noticeDao;

    @Override
    public List<VONotice> findAll( int page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<VONotice> all = noticeDao.findAll();
        return all;
    }

    @Override
    public void addNotice(Notice notice) {
//        Notice notice = new Notice();
//        notice.setUid(id);
//        notice.setContent(content);
//        notice.setCreateDate(createDate);
//        notice.setTitle(title);

        noticeDao.addNotice(notice);

    }

    @Override
    public void deleteNotice(Integer id) {
        noticeDao.deleteNotice(id);
    }

}
